Asset Spatial Search
Introduction
The Assetic REST API endpoint GET /api/v2/assets/locations is used to get a list of assets within a specified distance of a spatial point.
The core fields of the asset are returned. If the field is null for all records in the result page then the field is omitted from the results. The list of core asset fields is defined in the article Asset Integration Overview.
Search Parameters
The following parameter are used to define the search:
Parameter | Description | Type | Mandatory |
Longitude | The longitude of the search point | Decimal Degrees | Yes |
Latitude | The latitude of the search point | Decimal Degrees | Yes |
Condition | The search conditions, currently only one condition criteria is implemented. It is 'near_point'. | String | Yes |
Range | The radius of the search from the defined point. All assets that intersect with this radius will be included in the search result. | Float | Yes |
Unit | The unit of the range. Must be one of 'kilometer' or 'meter' | String | Yes |
Page | The page number to search (paginated response) | Integer | No |
PageSize | The number of records to return per page | Integer | No |
Sample Payload
The following payload performs a search of assets that are in a radius of 50m of the point latitude=-37.7189464838 and longitude=144.739308647.
GET /api/v2/assets/locations?requestParams.page=1&requestParams.range=50&requestParams.unit=meter&
requestParams.latitude=-37.7189464838&requestParams.longitude=144.739308647&
requestParams.condition=near_point&requestParams.pageSize=500
A sample python script for performing the sample payload above is provided for reference in this article on the Integration SDK page.